package com.my12306.train.controller;

import com.my12306.common.util.response.ResponseData;
import com.my12306.train.model.vo.StatisticsVo;
import com.my12306.train.service.StatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * 图标信息
 *
 * @author mifen¦
 */
@RestController
@RequestMapping("/statistics")
public class StatisticsController {
    @Autowired
    private StatisticsService statisticsService;

    /**
     * 图标信息
     */
    @GetMapping("/info")
    public ResponseData info() {
        List<StatisticsVo> statisticsVos = statisticsService.queryChartsParams();
        return ResponseData.ok().put("list", statisticsVos);
    }
    /**
     * 获取售票最多的五条路线
     */
    @GetMapping("/queryFiveRoutes")
    public ResponseData queryFiveRoutes() {
        return statisticsService.queryFiveRoutes();
    }

    /**
     * 获取售票金额最多的五个站点
     */
    @GetMapping("/queryFiveStations")
    public ResponseData queryFiveStations() {
        return statisticsService.queryFiveStations();
    }

    /**
     * 获取售票数量最多的十个站点
     */
    @GetMapping("/queryTenStations")
    public ResponseData queryTenStations() {
        return statisticsService.queryTenStations();
    }
}
